﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// 产品返工记录
/// </summary>
[SugarTable("qc_rework_record", "产品返工记录表")]
public class QcReworkRecord : EntityBaseId
{
    /// <summary>
    /// SN
    /// </summary>
    [NotNull]
    public string? Sn { get; set; }

    /// <summary>
    /// NG 的产线Id
    /// </summary>
    public long NgLineId { get; set; }

    /// <summary>
    /// NG 的产线编号
    /// </summary>
    [NotNull]
    public string? NgLineCode { get; set; }

    /// <summary>
    /// NG 的工位Id
    /// </summary>
    public long NgOpId { get; set; }

    /// <summary>
    /// NG 的工位编号
    /// </summary>
    [NotNull]
    public string? NgOpCode { get; set; }

    /// <summary>
    /// NG 的工序Id
    /// </summary>
    public long NgProcId { get; set; }

    /// <summary>
    /// NG 的工序编号
    /// </summary>
    [NotNull]
    public string? NgProcCode { get; set; }

    /// <summary>
    /// 当前所在的工艺路线 Id。没有则为 0。
    /// </summary>
    /// <remarks>线外站时设置为 0。</remarks>
    public long NgRoutingId { get; set; }

    /// <summary>
    /// 当前所在的工艺路线编号。
    /// </summary>
    /// <remarks>线外站产品，可设置为空。</remarks>
    [NotNull]
    public string? NgRoutingCode { get; set; }

    /// <summary>
    /// 操作人员
    /// </summary>
    public string? Operator { get; set; }

    /// <summary>
    /// 返修内容
    /// </summary>
    public string? Content { get; set; }

    /// <summary>
    /// 返工记录时间
    /// </summary>
    public DateTime RecordTime { get; set; }

    /// <summary>
    /// 数据版本，对应 Inbound 和 Archive。
    /// </summary>
    /// <remarks>用于数据关联</remarks>
    public long Version { get; set; }
}
